Optimisation of working DXL to print users in a group

Hello,

My database structure is Projects->Folder->Module.

I am trying to check within a project, if the item type is of type module(formal), then print the names of all the group and also the users within the group who have access to every formal module.

The attached script works perfectly fine, but it takes very long time to execute.

is there anything i am missing or any way to optimize the execution time of the script?

 

e.g. For module A, groups x,y have access. and memebers of group x are a1,b1,c1,d1 and members of group y are a1,b2,c2,d2,e2.

For module B groups x,y,z have access. and memebers of group x are a1,b1,c1,d1 and members of group y are a1,b2,c2,d2,e2 and members of group z are a3,b3,c3,d3,e3.

 

The issue here is that the same group may have access to many modules, so every time it finds a formal module, it prints that group and also its users again. so maybe this is taking time?


Gsquare - Thu Nov 29 04:07:48 EST 2018

Re: Optimisation of working DXL to print users in a group
Mike.Scharnow - Thu Nov 29 04:48:45 EST 2018

I don't have so many users and groups in my test database, but the script looks more or less fine (don't know if there is any problem in the missing function "removeDuplicates", but this should also not be a problem.

So, I assume that the problem is the rather slow "print" statement, see e.g. https://www.ibm.com/developerworks/community/forums/html/topic?id=9f32a2dc-93d8-4994-a8e2-1fe7214557ff for a solution

Re: Optimisation of working DXL to print users in a group
Gsquare - Thu Nov 29 05:32:12 EST 2018

Mike.Scharnow - Thu Nov 29 04:48:45 EST 2018

I don't have so many users and groups in my test database, but the script looks more or less fine (don't know if there is any problem in the missing function "removeDuplicates", but this should also not be a problem.

So, I assume that the problem is the rather slow "print" statement, see e.g. https://www.ibm.com/developerworks/community/forums/html/topic?id=9f32a2dc-93d8-4994-a8e2-1fe7214557ff for a solution

Thanks for the hint Mike,

I will try to write the output to a file rather than print in the DXL window and check the performance.

Note: This script works well if access rights for EveryOne Else other than the groups is set to R or anything other than null. In case everyone else is null, it takes time only then

Re: Optimisation of working DXL to print users in a group
Mike.Scharnow - Thu Nov 29 05:51:58 EST 2018

Gsquare - Thu Nov 29 05:32:12 EST 2018

Thanks for the hint Mike,

I will try to write the output to a file rather than print in the DXL window and check the performance.

Note: This script works well if access rights for EveryOne Else other than the groups is set to R or anything other than null. In case everyone else is null, it takes time only then

Hm, I'm not sure if I understood that correctly. You say that when the script goes to line 42 (unused variable accessStr is set to ""), and nothing is printed, then the script gets slow?

That's really strange - I assume that the problem lies elsewhere, perhaps in a part of the code that you did not post?

Re: Optimisation of working DXL to print users in a group
Gsquare - Thu Nov 29 07:32:27 EST 2018

Mike.Scharnow - Thu Nov 29 04:48:45 EST 2018

I don't have so many users and groups in my test database, but the script looks more or less fine (don't know if there is any problem in the missing function "removeDuplicates", but this should also not be a problem.

So, I assume that the problem is the rather slow "print" statement, see e.g. https://www.ibm.com/developerworks/community/forums/html/topic?id=9f32a2dc-93d8-4994-a8e2-1fe7214557ff for a solution

Thanks Mike,

The write to file instead of print did the trick.

Wait time reduced from 20 minutes to 10 seconds(max)